﻿using System;
using MyAnt.Core.Model.World;
using MyAnt.Core.Resource;

namespace MyAnt.Core.World
{
	public class Sector
	{
		public int Width { get; private set; }
		public int Height { get; private set; }
		public int Depth { get; private set; }

		private ResourceType[, ,] _sector;

		public Sector(int w, int h, int d)
		{
			Width = w;
			Height = h;
			Depth = d;
			_sector = SectorBuilder.CreateStandardSector(w, h, d);
			
		}

		public ResourceType Get(int x, int y, int z)
		{
			return _sector[x, y, z];
		}

		public ResourceType Pickup(int x, int y, int z)
		{
			var r = Get(x, y, z);
			_sector[x, y, z] = ResourceUtil.PickupReplace(r);
			return ResourceUtil.Pickup(r);
		}
	}
}
